8ff03b9c18cc20893d5196bd9fb1194b8d7e8b0d,sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/CustomDeclarationOrderCheck.java,CustomDeclarationOrderCheck,getPositionInOrderDeclaration,#DetailAST#,591
Before Change
{
int result = -1;
final String modifiers = getCombinedModifiersList(ast);
for (int index = 0; index < customOrderDeclaration.size(); index++) {
final FormatMatcher currentRule = customOrderDeclaration.get(index);
if (currentRule.getClassMember() == ast.getType()
&& currentRule.getRegexp().matcher(modifiers).find())
{
if (currentRule.hasRule(ANNON_CLASS_FIELD_MACRO)) {
if (isAnonymousClassField(ast)) {
result = index;
break;
}
}
else if (currentRule.hasRule(GETTER_SETTER_MACRO)) {
final String methodName = getIdentifier(ast);
final ClassDetail classDetail = classDetails.peek();
if (classDetail.containsGetter(methodName)
|| classDetail.containsSetter(methodName))
{
result = index;
break;
}
}
else if (currentRule.hasRule(MAIN_METHOD_MACRO)) {
if (isMainMethod(ast)) {
After Change
{
int result = -1;
final String modifiers = getCombinedModifiersList(ast);
for (int index = 0; index < customOrderDeclaration.size() && result != 1; index++) {
final FormatMatcher currentRule = customOrderDeclaration.get(index);
if (currentRule.getClassMember() == ast.getType()
&& currentRule.getRegexp().matcher(modifiers).find())
{
if (currentRule.hasRule(ANNON_CLASS_FIELD_MACRO)
|| currentRule.hasRule(GETTER_SETTER_MACRO)
|| currentRule.hasRule(MAIN_METHOD_MACRO)) {
final String methodName = getIdentifier(ast);
final ClassDetail classDetail = classDetails.peek();